import type { AccountTypeCnEnum, CollectionAccountStatusCnEnum, CollectionAccountTypeCnEnum, ProductTypeEnum } from '@/const/enum'
import type { EnumDto } from '../types'
import type { UploadFileDto } from '@/components/file/Upload'

export interface CustomReqDto {
  /**
   * 账号状态(0:启用,3:禁用,4:解散)
   */
  accountStatus?: number
  /**
   * 超管信息（姓名、手机号）
   */
  adminInfo?: string
  /**
   * 余额状态(0:全部，1:有余额，2:为零)
   */
  balanceType?: number
  /**
   * 渠道id
   */
  channelId?: number
  companyIds?: string[]
  /**
   * 公司名称
   */
  companyName?: string
  /**
   * 查询结束时间
   */
  endTime?: string
  /**
   * 是否开通电子签
   */
  isOpenEleSign?: number
  /**
   * 是否开通发薪
   */
  isOpenPaySalary?: number
  /**
   * 是否开通长期保
   */
  isOpenPeriod?: number
  /**
   * 是否开通团意险
   */
  isOpenTyrbStatus?: number
  /**
   * 是否开通日日保
   */
  isOpenWesure?: number
  /**
   * 所属销售
   */
  saleName?: string
  /**
   * 查询开始时间
   */
  startTime?: string
}

export interface CustomDto {
  companyId: number
  companyName: string
  companyAbbreviation: string
  creditCode: string
  auditStatus: number
  legalPerson: string
  area: string
  subMchid: string
  isOpenSalaryCard: number
  payAccount: null
  eleSign: null
  payroll: null
  isOpenDaily: null
  periodAccount: null
  wesurAccount: null
  tyxAccount: null
  eleAccount: null
  smsAccount: null
  adminName: string
  adminPhone: string
  isOpenPaySalary: number
  paySaleName: string
  paySaleId: number
  payDealId: number
  paySurplusDays: number
  accountExpireTime: string
  isOpenWesure: number
  wesureSaleName: null
  wesureSaleId: null
  wesureDealId: null
  wesureAccountBalance: null
  isOpenTyrbStatus: number
  tyxAccountBalance: null
  tyxSaleName: string
  tyxSaleId: number
  tyxDealId: number
  isOpenPeriod: number
  periodSaleName: string
  periodSaleId: number
  periodDealId: number
  periodAccountBalance: number
  insurCompanyType: null
  isOpenEleSign: number
  eleSaleName: null
  eleSaleId: null
  eleDealId: null
  eleAccountBalance: null
  smsBalance: null
  channelId: null
  channelName: string[]
  bankName: string[]
  balanceType: null
  saleName: null
  companyIds: null
  salesCompanyIds: null
  insurCompany: null
  weusreStatus: null
  periodInsureStatus: PeriodInsureStatusDto
  wesurBlackList: null
  insureBlackList: null
  isDissolve: number
  sortField: null
  sortType: null
  source: null
  isOpenAdvance: null
}

interface PeriodInsureStatusDto {
  refusalGuaranteeStatus: number
  blockedAccount: number
  antiDatedPolicy: number
}

export interface CompanyDto {
  companyName: string
  auditStatus: number
  id: number
  label?: string
  value?: number
}

export interface ChannelDto {
  id: number
  name: string
  auditStatus: number
  contacts: string
  area: string
  phone: string
  isOpenPc: number
  dataScope: number
  type: number
  createTime: string
  createUserId: number
  updateTime: null
  updateUserId: null
  params: ParamsDto
  saasReceiptAccountInfoList: null
}

export interface ParamsDto {
}


export interface PeriodInfoDto {
  companyId: number
  dealId: number
  serviceState: number
  isOpenPeriod: number
  productOpenTime: string
  saleId: number
  salesName: string
  wesureBalance: number
  claimRate: null
  increaseRate: number
  allowOverageEnsure: number
  openRebate: number
  periodCompanyTypeList: string[]
  periodInsureCount: number
  periodPlanTypeList: string[]
  refusalGuaranteeStatus: number
  periodOverdraftAmount: number
  totalRechargeAmount: number
  bankName: string
  receiptId: number
  channelName: string
  channelId: number
  openQrProjectEnsure: number
  creditCodePicture: string | string[]
}

export interface OpenAccountDto {
  id: number
  source: number
  companyName: string
  companyAbbreviation: null
  creditCode: string
  merchantBankCard: null
  auditStatus: number
  legalPerson: string
  area: string
  subMchid: null
  dailyQuota: null
  personSingleQuota: null
  createTime: string
  openAnAccountTime: string
  isOpenSalaryCard: number
  isOpenPaySalary: number
  isOpenWesure: number
  isOpenPayRepeatReminder: null
  isNeedAuthSalaryCard: null
  isOpenZp: number
  balanceRemind: null
  insureCompanyType: string
  qyWxQrcodeId: number
  bookSubUnit: null
  qyWxQrcodeUrl: null
  isWesureUser: number
  createUserId: number
  updateTime: string
  updateUserId: number
  ids: null
  expirationDate: null
  wesureBalance: null
  insureTypeList: null
  isOpenPeriod: null
  periodCompanyTypeList: null
  periodPlanTypeList: null
  periodPlanTypeNameList: null
  insureType: string
  policyPeopleCount: null
  policyCount: null
  wesureType: null
  wesureTypeName: string
  isOpenEleSign: number
  signInMode: number
  salesName: null
  params: ParamsDto
  payAccountRechargeRecords: null
  rechargeMonthNumber: number
  accountExpireTime: string
  accountOpeningFee: null
  validTime: null
  employeeLibrary: null
  receiptId: null
  bankName: null
  isOpenTyrbStatus: null
  insurCompany: null
  channelId: null
  channelName: null
  businessLicenseAddress: null
  queryDate: null
  productType: null
  bySeatCount: null
  status: null
  companyNameList: null
  notLikeCompanyName: null
  accountLimit: null
  operatorName: null
  operatorIdCard: null
  contact: null
  isAgent: null
  isOpenAlipay: null
  isOpenWechatPay: null
  openQrProjectEnsure: null
  wxAccountBalance: null
  alipayAccountBalance: null
  creditCodePicture: null
  openWesure: boolean
  openEleSign: boolean
}

export interface CompanyInfoDto {
  companyId: number
  companyName: string
  auditStatus: number
  openAnAccountTime: string
  accountExpireTime: null
  companyAbbreviation: null
  bankName: string
  receiptId: number
  creditCode: string
  legalPerson: string
  merchantBankCard: null
  area: string
  smsBalance: null
  channelId: number
  channelName: string
  isOpenSalaryCard: number
  openProduct: number[]
  subMchid: null
  dailyQuota: number
  personSingleQuota: number
  businessLicenseAddress: string
}

export interface UpdateCompanyInfoReqDto {
  id: number
  auditStatus: number
  companyAbbreviation: string | null
  receiptId: number
  creditCode: string
  legalPerson: string
  merchantBankCard: string | null
  area: string
  channelId: number
  isOpenSalaryCard?: number
  productType?: ProductTypeEnum.PAYWAGE | ProductTypeEnum.PERIOD | ProductTypeEnum.GROUP | ProductTypeEnum.DALIY | ProductTypeEnum.ELESIGN
  isOpenWechatPay?: number
  isOpenAlipay?: number
  companyName?: string
  subMchid?: string | null
  businessLicenseAddress?: string
  dailyQuota?: number
  personSingleQuota?: number

  isOpenPeriod?: number
  isOpenPaySalary?: number
  isOpenWesure?: number
  isOpenEleSign?: number

  saleId?: number
}

export interface PayWageInfoDto {
  companyId: number
  dealId: number
  isOpenPaySalary: number
  payProductOpenTime: string
  accountExpireTime: string
  payAccountBalance: number
  payAlipayAccountBalance: number
  patMoneyCount: null
  validTime: string
  merchantBankCard: string
  superParentName: string
  phone: string
  bankName: string
  saleId: number
  saleName: string
  channelName: string
  channelId: number
  receiptId: number
  hasSeat: number
  useSeat: number
  isOpenAlipay: number
  alipayRegisterStatus: number
  isOpenWechatPay: number
  dailyQuota: number
  personSingleQuota: number
  openAccountType?: number[]
  salePhone: string
}

export interface ClaimDto {
  dailyInsur: ClaimItemDto | null
  periodInsur: ClaimItemDto | null
  tyInsur: ClaimItemDto | null
}

export interface ClaimItemDto {
  companyId: number
  companyName: string
  saleName: string
  type: number
  name: null
  area: string
  status: number
  createTime: null
  params: Params
  allStaffCount: null
  staffCount: null
  beConfirmedCount: null
  caseAmount: null
  caseCancelAmount: null
  estimateMoney: null
  finalMoney: null
  industryName: null
  caseCancelRate: string
  totalPrice: null
  claimRate: string
  increaseRate: null
  occupationIds: null
  occupationName: null
  claimRateQuery: null
  overCaseMoney: null
  orderRule: null
  orderProp: null
  orderFlag: null
  insureCompanyType: null
  finalAmount: null
  refuseAmount: null
  serveCompanyNames: null
  companyIds: null
  insureTypeName?: string
}

interface Params {
}

export interface PeriodInfoReqDto extends UpdateCompanyInfoReqDto {
  creditCodePicture: string
  openQrProjectEnsure: number
  periodCompanyTypeList: string[]
  periodPlanTypeList: string[]
}



export interface WesureInfoDto {
  companyId: number
  dealId: number
  serviceState: number
  isOpenWesure: number
  isOpenTyrbStatus: null
  productOpenTime: string
  saleId: number
  salesName: string
  wesureBalance: number
  insureCompanyType: string
  insureCompanyName: string
  blockedAccount: number
  refusalGuaranteeStatus: number
  antiDatedPolicy: number
  insureClaimRate: null
  insureIncreaseRate: null
  insureType: string
  bankName: string
  receiptId: number
  channelName: string
  channelId: number
  creditCodePicture: string
  insureTypeList?: string[]
}


export interface GroupInfoDto {
  companyId: number
  dealId: number
  serviceState: number
  isOpenWesure: null
  isOpenTyrbStatus: number
  productOpenTime: string
  saleId: number
  salesName: string
  wesureBalance: null
  insureCompanyType: null
  insureCompanyName: null
  blockedAccount: null
  refusalGuaranteeStatus: null
  antiDatedPolicy: null
  insureClaimRate: null
  insureIncreaseRate: null
  insureType: null
  bankName: null
  receiptId: null
  channelName: null
  channelId: null
}


export interface SaveTyxReqDto {
  id: number
  insurCompany: string
  subMchid: string
  accountLimit: string
  operatorName: string
  operatorIdCard: string
  contact: string
  productType: number
  channelId: string | null
  receiptId: string | null
  saleId?: number
}

export interface ElesignRecordReqDto {
  companyId: number
  searchName?: string
  searchFields?: string
  flowStatus?: string
  createOn?: string
  deadline?: string
}

export interface EleSignInfoDto {
  /**
   * 到期时间
   */
  accountExpireTime?: string
  /**
   * 公司id
   */
  companyId?: number
  /**
   * 签单id
   */
  dealId?: number
  /**
   * 剩余份数
   */
  eleAmount?: number
  /**
   * 电子签开通时间
   */
  eleProductOpenTime?: string
  /**
   * 电子签所属销售
   */
  eleSaleName?: string
  /**
   * 商务手机号
   */
  eleSalePhone: string
  /**
   * 已签署份数
   */
  eleSignConsumeAmount?: number
  /**
   * 预计到期份数
   */
  expectDueAmount?: number
  /**
   * 身份证号
   */
  idCardNo?: string
  /**
   * 是否开通电子签
   */
  isOpenEleSign?: number
  /**
   * 手机号
   */
  phone?: string
  /**
   * 销售id
   */
  saleId?: number
  /**
   * 签单服务阶段
   */
  serviceState?: number
  /**
   * 人员状态（0=未激活,1=已激活,2=离职）
   */
  status?: number
  /**
   * 待签署份数
   */
  unsignedAmount?: number
  /**
   * 合同操作人
   */
  userName?: string
}

export interface ElesignTemplateReqDto {
  companyId: number
  searchName?: string
  userName?: string
  queryTime?: string
}

export interface ElesignTemplateDto {
  searchText: null
  ids: null
  id: number
  companyId: number
  companyName: string
  flowType: number
  templateName: string
  flowDescription: string
  userId: null
  managerRecordId: number
  userName: string
  components: null
  signComponents: null
  recipients: null
  templateId: string
  templateType: number
  isDelete: null
  createUserId: null
  updateUserId: null
  createTime: string
  updateTime: null
  effectiveTime: number
  unit: number
  beginCreateTime: null
  endCreateTime: null
  params: Params
  searchName: null
  queryTime: null
  isPcAdmin: null
}

export interface ElesignTemplateReqDto {
  companyId: number
  searchName?: string
  userName?: string
  queryTime?: string
}

export interface ElesignTemplateDto {
  searchText: null
  ids: null
  id: number
  companyId: number
  companyName: string
  flowType: number
  templateName: string
  flowDescription: string
  userId: null
  managerRecordId: number
  userName: string
  components: null
  signComponents: null
  recipients: null
  templateId: string
  templateType: number
  isDelete: null
  createUserId: null
  updateUserId: null
  createTime: string
  updateTime: null
  effectiveTime: number
  unit: number
  beginCreateTime: null
  endCreateTime: null
  params: Params
  searchName: null
  queryTime: null
  isPcAdmin: null
}

export interface RechargeReqDto {
  productType: ProductTypeEnum.PAYWAGE | ProductTypeEnum.ELESIGN | ProductTypeEnum.GROUP_MESSAGE | ProductTypeEnum.PERIOD | ProductTypeEnum.DALIY | ProductTypeEnum.GROUP
  companyName?: string
  status?: number
  payMode?: number
  queryStartDate?: string
  queryEndDate?: string
}

export interface RechargeDto {
  id: number
  companyId: number
  companyName: string
  productType: number
  status: number
  voucherUrl: string
  payMoney: string
  ocrAmount: string
  operationType: null
  rechargeAmount: null
  createTime: string
  remark: null
  payMode: number
  salesScenario: null
  channelName: string
  receiptId: number
  bankName: string
  type: number
  operateFlag: null
  accountExpireTime: null
  buySeatCount: null
  queryStartDate: null
  queryEndDate: null
  isRepeat: number
}

export interface AuditCountDto {
  dailyRe: number
  invoices: number
  periodRe: number
  periodSvc: number
  dailySvc: number
}


export interface CompanyProductInfoDto {
  /**
   * 账户状态
   */
  auditStatus: number
  /**
   * 公司id
   */
  companyId: number
  /**
   * 公司名称
   */
  companyName: string
  /**
   * 客户编号
   */
  customerNo: string
  /**
   * 电子签剩余份数
   */
  eleSurplusAmount: number
  /**
   * 团意保余额
   */
  groupBalance: number
  /**
   * 是否开通电子签
   */
  isOpenEleSign: number
  /**
   * 是否开通团意保
   */
  isOpenGroup: number
  /**
   * 是否开通子弹发薪
   */
  isOpenPaySalary: number
  /**
   * 是否开通长期保
   */
  isOpenPeriod: number
  /**
   * 是否开通日日保
   */
  isOpenWesure: number
  /**
   * 发薪账户剩余天数
   */
  paySurplusDays: number
  /**
   * 长期保余额
   */
  periodBalance: number
  /**
   * 商户号
   */
  subMchid: string
  /**
   * 日日保余额
   */
  wesureBalance: number
}


export interface CompanyDetailDto {
  /**
   * 发薪账户过期时间
   */
  accountExpireTime?: string
  /**
   * 地址
   */
  area?: string
  /**
   * 审核状态(0:待审核，1:审核通过，2:审核驳回)
   */
  auditStatus: number
  /**
   * 默认收款账户
   */
  bankName?: string
  /**
   * 营业执照地址
   */
  businessLicenseAddress?: string
  /**
   * 默认渠道id
   */
  channelId?: number
  /**
   * 默认渠道名称
   */
  channelName?: string
  /**
   * 公司简称
   */
  companyAbbreviation?: string
  /**
   * 公司id
   */
  companyId?: number
  /**
   * 公司名称
   */
  companyName?: string
  /**
   * 创建人
   */
  createBy?: string
  /**
   * 创建人电话
   */
  createByPhone?: string
  /**
   * 创建时间
   */
  createTime?: string
  /**
   * 营业执照编码
   */
  creditCode?: string
  /**
   * 营业执照
   */
  creditCodePicture: string
  /**
   * 客户id
   */
  customerNo?: string
  /**
   * 单日额度
   */
  dailyQuota?: number
  /**
   * 法人姓名
   */
  legalPerson?: string
  /**
   * 开户行及行号/充值账号
   */
  merchantBankCard?: string
  /**
   * 开通时间
   */
  openAnAccountTime?: string
  /**
   * 已开通业务
   */
  openProduct?: number[]
  /**
   * 单日可领额度
   */
  personSingleQuota?: number
  /**
   * 默认收款账户id
   */
  receiptId?: number
  /**
   * 商户号
   */
  subMchid?: string
  /**
   * 超管
   */
  supAdminName?: string
  /**
   * 超管电话
   */
  supAdminPhone?: string
}



export interface PayRecordDto {
  /**
   * 发薪时间
   */
  approvalTime: string
  /**
   * 发薪方式（10001：微信，20001：支付宝）
   */
  payAccountFlag: number
  /**
   * 停发金额
   */
  payStopTotalMoney: number
  /**
   * 发薪人数
   */
  peopleNum: number
  /**
   * 项目名称
   */
  projectName: string
  /**
   * 被派遣单位
   */
  serveCompanyName: string
  /**
   * 发新状态(0:进行中，1：已通过；2：已驳回3:已取消)
   */
  state: number
  /**
   * 发薪金额
   */
  totalMoney: number
}


export interface CompanyProcessDto {
    /**
     * 申请理由
     */
    applyRemark: string
    /**
     * 申请时间
     */
    applyTime: string
    /**
     * 申请人id
     */
    applyUserId: number
    /**
     * 申请人
     */
    applyUserName: string
    /**
     * 区域
     */
    area: string
    /**
     * 营业执照地址
     */
    businessLicenseAddress: string
    /**
     * 市
     */
    city: string
    /**
     * 公司id
     */
    companyId: number
    /**
     * 公司名称
     */
    companyName: string
    /**
     * 详细地址
     */
    detailAddress: string
    /**
     * 区
     */
    district: string
    /**
     * 主键
     */
    id: number
    /**
     * 是否重复注册(0:否，1:是)
     */
    isRepeat: number
    /**
     * 操作类型（0：新建公司，1：重新审核）
     */
    operationType: number
    params: Params
    /**
     * 手机号
     */
    phone: string
    /**
     * 职位
     */
    position: string
    /**
     * 查询结束时间
     */
    queryEndDate: string
    /**
     * 查询开始时间
     */
    queryStartDate: string
    /**
     * 状态（0：待审核，1：已通过，2：驳回）
     */
    status: number
    /**
     * 修改时间
     */
    updateTime: string
    /**
     * 修改人
     */
    updateUserId: number
}

interface Params {
}

export interface CollectionAccountDto {
  companyName: string
  productType: number
  status: number
  companyId: number
  voucherUrl: null
  operateAmount: number
  type: number
  createTime: string
  remark: string
  payMode: number
  channelName: null
  channelId: null
  bankName: null
  receiptId: number
  id: number
  accountExpireTime: string
  rechargeAmount: null
  buySeatCount: null
  salesScenario: null
  dueDate: null
  seatExpirationTime: null
  startTime: null
  endTime: null
  startMonth: null
  endMonth: null
  position: null
  selectType: null
}

export interface CollectionAccountReqDto {
    selectType: CollectionAccountTypeCnEnum
    position: 1 // 固定传 1
    type?: AccountTypeCnEnum.余额转出 | AccountTypeCnEnum.余额转入
    companyId?: number
    startTime?: string
    endTime?: string
    productType?: number
    status?: CollectionAccountStatusCnEnum
}